set the member of sprite (menuStart + i - 1) to member (getAt(menuList,i)&"down") of castLib "Buttons"
else
set the member of sprite (menuStart + i - 1) to member getAt(menuList,i) of castLib "Buttons"
end if
set the height of sprite (menuStart + i - 1) to the height of member getAt(menuList,i) of castLib "Buttons"
set the width of sprite (menuStart + i - 1) to the width of member getAt(menuList,i) of castLib "Buttons"
set the loc of sprite (menuStart + i - 1) to spritePos
set spritePos = spritePos + point(the width of member getAt(menuList,i) of castLib "Buttons",0)
set the visible of sprite (menuStart + i - 1) to true
end repeat
end showMenu
on hideMenu me
repeat with i = 1 to count(menuList)
set the member of sprite (menuStart + i - 1) to 0
puppetSprite (menuStart + i - 1), false
set the visible of sprite (menuStart + i - 1) to false
end repeat
end hideMenu
on downOption me
if (the attemptChosenOption of me <> the chosenOption of me) then
set the member of sprite (menuStart + the attemptChosenOption of me - 1) to member (getAt(menuList,the attemptChosenOption of me)&"down") of castLib "Buttons"
set the member of sprite (menuStart + the ChosenOption of me - 1) to member getAt(menuList,the ChosenOption of me) of castLib "Buttons"
set the chosenOption of me to the attemptChosenOption of me
set the visible of sprite 30 to false
updateStage
puppetsprite 30,false
puppetSprite 33,false
actionMenu me
end if
end downOption
on actionMenu me
set searchTerm = getAt(the menuList of me,the chosenOption of me)
global imageBar,toolBar,fullImageList
set imageBar = []
set toolBar = []
set imageList = setUpImageList (fullImageList,searchTerm)
if (getAt(getAt(imageList,count(imageList)),3) + getAt(getAt(imageList,count(imageList)),4)) < 460 then
set toolBar = new(script"Toolbar Parent Script",["top",point(0,-2),"middle",point(0,0),"bottom",point(0,2)],5,point(115,372),372,372)
set imageBar = new(script "ScrollingImageBar",(getAt(getAt(imageList,count(imageList)),3) + getAt(getAt(imageList,count(imageList)),4)) ,point(0,21),470,(the maxVPos of toolBar - the minVPos of toolBar),imageList)
else
set toolBar = new(script"Toolbar Parent Script",["top",point(0,-2),"middle",point(0,0),"bottom",point(0,2)],5,point(115,372),372,372)
set imageBar = new(script "ScrollingImageBar",(getAt(getAt(imageList,count(imageList)),3) + getAt(getAt(imageList,count(imageList)),4)) ,point(0,21),470,(the maxVPos of toolBar - the minVPos of toolBar),imageList)
end if
displayBar imageBar,6,(the locV of the toolLoc of toolBar - the minVPos of toolBar)
updateStage
set the attemptSelectedImage of imageBar to getAt(the selectedImageList of imageBar, 1)